<
%@ page import="br.edu.ufam.avaliacao.Avaliacao" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="layout" content="main" />
<g:set var="entityName" value="${message(code: 'avaliacao.label', default: 'Avaliacao')}" />
<title><g:message code="default.list.label" args="[entityName]" /></title>
</head>
<body>


  <div class="body" style="width: 1000px">
    <h1><g:message code="Lista de Avaliações" /></h1>
    <g:if test="${flash.message}">
      <div class="message">${flash.message}</div>
    </g:if>

    <br>
    <div class="list" >
      <table>
        <thead>
          <tr  id="testDouglas">

        <g:sortableColumn property="curso" title="${message(code: 'avaliacao.curso.label', default: 'Curso')}" />

        <g:sortableColumn property="avaliador" title="${message(code: 'avaliacao.usuario.label', default: 'Avaliador')}" /> 

        <g:sortableColumn property="conceitoFinal" title="${message(code: 'avaliacao.conceitoFinal.label', default: 'Conceito Final')}" /> 

        <g:sortableColumn property="dateStart" title="${message(code: 'avaliacao.dateStart.label', default: 'Data Início')}" /> 

        <g:sortableColumn property="dateEnd" title="${message(code: 'avaliacao.dateEnd.label', default: 'Data Fim')}" /> 

        <g:sortableColumn property="status" title="${message(code: 'avaliacao.status.label', default: 'Status')}" /> 

        </tr>
        </thead>
        <tbody>
        <g:each in="${avaliacaoInstanceList}" status="i" var="avaliacaoInstance">
          <tr class="${(i % 2) == 0 ? 'odd' : 'even'}"  id="testDouglas">

            <td><g:link action="show" id="${avaliacaoInstance.id}">${fieldValue(bean: avaliacaoInstance, field: "curso.nomeCursoDiploma")}</g:link></td>

          <td>${fieldValue(bean: avaliacaoInstance, field: "usuario")}</td>

          <td>${fieldValue(bean: avaliacaoInstance, field: "conceitoFinal")}</td>

          <td>${avaliacaoInstance.dateStart.format("dd/MM/yyyy")}</td>

          <td>${avaliacaoInstance.dateEnd.format("dd/MM/yyyy")}</td>

          <td><g:if test="${avaliacaoInstance.status=='Coordenador'}">
            <g:link action="show" id="${avaliacaoInstance.id}"><img src="../images/skin/teacher_4.png" width="24" height="24"></g:link>
          </g:if>
          <g:elseif test="${avaliacaoInstance.status=='Em andamento' }">
            <g:link action="show" id="${avaliacaoInstance.id}"><img src="../images/skin/avaliador_3.png" width="24" height="24"></g:link>
          </g:elseif>
          <g:else>
            <g:link action="show" id="${avaliacaoInstance.id}"><img src="../images/skin/finalizado_3.png" width="24" height="24"></g:link>
          </g:else>
          </td>

          </tr>
        </g:each>
        </tbody>
      </table>
    </div>
    <div class="paginateButtons">
      <g:paginate total="${avaliacaoInstanceTotal}" />
    </div>

    <br><br>

    <div style="width: 100% ; text-align: center">                     
      <g:form name="legendaForm" >
        <table class="tabelas" cellpadding="5" cellspacing="1">
          <tr>

            <td  align="center" > <img src="../images/skin/teacher_4.png" width="24" height="24"> </td>
            <td > <strong>Aguardando a avaliação do COORDENADOR</strong></td>

            <td  align="center" > <img src="../images/skin/avaliador_3.png" width="24" height="24"> </td>
            <td > <strong>A avalição está EM ANDAMENTO</strong></td>

            <td  align="center" > <img src="../images/skin/finalizado_3.png" width="24" height="24"> </td>
            <td > <strong>Avaliação FINALIZADA</strong></td>

          </tr>

        </table>                    
      </g:form>
      <br/>                
    </div>


  </div>
</body>
</html>
